package com.thinkgem.jeesite.modules.erp.dao;

import java.util.List;
import java.util.Map;

import com.thinkgem.jeesite.common.persistence.CrudDao;
import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
import com.thinkgem.jeesite.modules.erp.entity.Department;
import com.thinkgem.jeesite.modules.erp.entity.Goods;
import com.thinkgem.jeesite.modules.erp.entity.OutAndInWarehouseOrder;
import com.thinkgem.jeesite.modules.erp.entity.Repository;
import com.thinkgem.jeesite.modules.erp.entity.User;
import com.thinkgem.jeesite.modules.oa.entity.Leave;

@MyBatisDao
public interface WareHouseDao {

	//查询部门下员工
	public List<Map<String,Object>> queryUsersByDep(String depid);
	//查询子部门
	public List<Map<String,Object>> queryDepsByParent(String depid);
	//查询部门信息
	public Department queryDepInfo(String depid);
	//模糊查询物品
	public List<Goods> dimQueryGoods(Map<String,Object> keyword);
	
	public List<Goods> queryAllGoods();
	
	//新增入库订单基本信息
	public void saveInputOrderBaseInfo(OutAndInWarehouseOrder op);
	//订单货物信息
	public void saveOrderGoodsInfo(Map<String, Object> map);
	//修正库存数量
	public void updateGoodsAmount(Map<String, Object> map);
	//获取个人的订单
	public List<OutAndInWarehouseOrder> getPersonalOrders(OutAndInWarehouseOrder order);
	//新增出库订单信息
	public void beTakeOutStorage(OutAndInWarehouseOrder op);
	//查询订单
	public List<OutAndInWarehouseOrder> queryRelevantOrders(OutAndInWarehouseOrder order);
	//查询出物品数量
	public Map<String, Object> queryGoodsAmount(String string);
	//修改订单状态
	public void updateOrdersStatus(Map<String, Object> map);
	//查询返回需要出库的物件标识和数量
	public List<Map<String, Object>> queryReduceInfo(String code);
	//减少对应的库存量
	public void updateReduce(Map<String, Object> map);
	//查询所有的仓库
	public List<Repository> queryAllRepository();
	//删除仓库
	public void deleteRepository(String repId);
	//查询仓库是否存在
	public Repository queryRepositoryExist(String name);
	//新增仓库
	public void addRepository(Repository repository);
	//修改仓库信息
	public void updateRepository(Repository repository);
	//分页查询仓库
	public List<Map<String, Object>> queryRepositoryByPage(Map<String, Object> map);
	//查询订单自增id
	public String queryOrdersId(OutAndInWarehouseOrder op);
	//删除订单货物信息
	public void deleteOrdersInfo(String id);
	//批量插入订单信息
	public void foreachInsertOrdersInfo(List<Map<String, Object>> list);
	//获取次数
	public Map<String, Object> ordersTimes();
	//次数加1
	public void addTimesOne(Map<String, Object> par);
	//修改物件数量和所在仓库地址
	public void updateGoodsAmountRepository(Map<String, Object> map);
	//新增仓库并可以返回自增的id
	public void saveRepositoryReturnId(Repository rep);
	
	public List<Repository> queryRepositoryTree(String parentid);
	//查询货架下面的总物品数
	public Integer queryRepositoryMaterialAmount(Map<String, Object> map);
	
	public String queryRepositoryName(String repository);
	
	public Map<String,Object> queryRepositoryExistExcludeSelf(Repository repository);
	
	public OutAndInWarehouseOrder queryPutInOnlyOrders(Map<String, Object> map);
	//暂时保存订单
	public void inTemporarilySave(OutAndInWarehouseOrder op);
	
	public OutAndInWarehouseOrder queryPersonalUnfinishedOrders(Map<String, Object> map);
	//根据订单号删除订单
	public void deleteTemporarilyOrders(OutAndInWarehouseOrder op);
	//设置物料仓库信息
	public void updateGoodsRepository(Map<String, Object> map);
	
	public Repository queryRepositoryExistByCode(String string);
	
	public List<OutAndInWarehouseOrder> ajQueryOrders(OutAndInWarehouseOrder order);
	
	
	
}
